from django.db import models
from django.contrib.auth.models import User

# Create your models here.

class Certificate(models.Model):
    """证书信息表"""
    sort = models.CharField(max_length=255, blank=True, verbose_name='类别', db_comment='证书类别')
    name = models.CharField(max_length=255, blank=True, verbose_name='证书名', db_comment='证书名称')
    ranks = models.CharField(max_length=255, blank=True, verbose_name='级别', db_comment='证书级别')
    classes = models.CharField(max_length=255, blank=True, verbose_name='等级', db_comment='证书等级')
    grade = models.IntegerField(default=0, verbose_name='分数', db_comment='对应分数')
    
    class Meta:
        db_table = 'zongce_certificate'
        verbose_name = '证书信息'
        verbose_name_plural = '证书信息'
        ordering = ['-id']
        db_table_comment = '证书信息表，存储各类证书的基本信息和评分标准'
    
    def __str__(self):
        return f"{self.name} - {self.ranks} - {self.classes}"
